package single.shop.core.web.controller;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;


/**
 * 
 * 
 * @author yinyt
 *
 */
public class BaseManageController extends MultiActionController
{

	private static final Logger log = LoggerFactory.getLogger(BaseManageController.class);

	private String loginUrl;
	
	
	/**
	 * 
	 * @param messageKey
	 * @return
	 */
	protected final ModelAndView error(String messageKey)
	{
		ModelAndView mv = new ModelAndView("error");
		mv.addObject("error", getMessageSourceAccessor().getMessage(messageKey));
		return mv;
	}

	/**
	 * 
	 * @param request
	 * @param messageKey
	 * @return
	 */
	protected final ModelAndView error(HttpServletRequest request, String messageKey)
	{
		ModelAndView mv = new ModelAndView("error");
		mv.addObject("error", getMessageSourceAccessor().getMessage(messageKey));

		return mv;
	}
	
}
